<!doctype html>
<html class="no-js">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Amaze UI Admin index Examples</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/png" href="__IMG__/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="__IMG__/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <link rel="stylesheet" href="{$Think.const.COMMON_URL}/Css/amazeui.min.css"/>
    <link rel="stylesheet" href="__CSS__/admin.css">
</head>
<body>
<!-- content start -->
<div class="admin-content">
    <form action="{:U('Wxaccount/edit')}" method="post">
        <div class="admin-content-body">
            <div class="am-cf am-padding am-padding-bottom-0">
                <div class="am-fl am-cf">
                    <strong class="am-text-primary am-text-lg">公众账号资料编辑</strong>
                </div>
            </div>

            <hr>

            <input type="hidden" name="id" value="{$wxaccount.id}"  />
            <form class="am-form">
                <div class="am-g am-margin-top-sm">
                    <div class="am-u-sm-4 am-u-md-2 am-text-right">
                        公众号昵称
                    </div>
                    <div class="am-u-sm-8 am-u-md-4 am-u-end">
                        <input type="text" class="am-form-field am-radius" name="wxname" value="{$wxaccount.wxname}" placeholder="请输入公众号昵称">
                    </div>
                </div>

                <div class="am-g am-margin-top-sm">
                    <div class="am-u-sm-4 am-u-md-2 am-text-right">
                        微信号:
                    </div>
                    <div class="am-u-sm-8 am-u-md-4 am-u-end">
                        <input type="text" class="am-form-field am-radius" name="weixin" value="{$wxaccount.weixin}" placeholder="请输入微信号">
                    </div>
                </div>

                <div class="am-g am-margin-top-sm">
                    <div class="am-u-sm-4 am-u-md-2 am-text-right">
                        原始ID:
                    </div>
                    <div class="am-u-sm-8 am-u-md-4 am-u-end">
                        <input type="text" class="am-form-field am-radius" name="wxuid" value="{$wxaccount.wxuid}" placeholder="请输入原始ID">
                    </div>
                </div>

                <div class="am-g am-margin-top-sm">
                    <div class="am-u-sm-4 am-u-md-2 am-text-right">
                        公众号APPID:
                    </div>
                    <div class="am-u-sm-8 am-u-md-4 am-u-end">
                        <input type="text" class="am-form-field am-radius" name="appid" value="{$wxaccount.appid}" placeholder="请输入公众号APPID">
                    </div>
                </div>

                <div class="am-g am-margin-top-sm">
                    <div class="am-u-sm-4 am-u-md-2 am-text-right">
                        公众号APPSECRET:
                    </div>
                    <div class="am-u-sm-8 am-u-md-4 am-u-end">
                        <input type="text" class="am-form-field am-radius" name="appsecret" value="{$wxaccount.appsecret}" placeholder="请输入公众号APPSECRET">
                    </div>
                </div>

                <div class="am-g am-margin-top-sm">
                    <div class="am-u-sm-4 am-u-md-2 am-text-right">
                        EncodingAESKey:
                    </div>
                    <div class="am-u-sm-8 am-u-md-4 am-u-end">
                        <input type="text" class="am-form-field am-radius required form-control" name="encodingAESKey" value="{$wxaccount.encodingaeskey}" id="encodingAESKey" placeholder="请输入EncodingAESKey" >
                        <a href="javascript:createEncodingAESKey();" class="am-btn am-btn-primary">重新生成</a>
                    </div>
                </div>


                <div class="am-margin">
                    <center>
                        <input type="submit" class="am-btn am-btn-primary am-btn-xs" value="提交保存">
                        <a href="{:U('Wxaccount/edit')}" class="am-btn am-btn-primary am-btn-xs">放弃保存</a>
                    </center>
                </div>
            </form>
        </div>

    </form>
    <script type="text/javascript">
        function createEncodingAESKey(){
            var encodingAESKey  = randomString();
            console.log(encodingAESKey);
            $("#encodingAESKey").val(encodingAESKey);
        }
        function randomString(len) {
            len = len || 43;
            var $chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
            var maxPos = $chars.length;
            var pwd = '';
            for (i = 0; i < len; i++) {
                pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
            }
            return pwd;
        }

    </script>

    <footer class="admin-content-footer">
        <hr>
        <center><p class="am-padding-left">© 2016 版权归郑建强所有.</p></center>
    </footer>
</div>
<!-- content end -->

<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="assets/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

<!--[if (gte IE 9)|!(IE)]><!-->
<script src="__COMMON__/Js/jquery.min.js"></script>
<!--<![endif]-->
<script src="__COMMON__/Js/amazeui.min.js"></script>
<script src="__COMMON__/Js/app.js"></script>
</body>
</html>